﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
namespace Sbook.Data
{
    public class CategoryInfo
    {
        #region[Declare variables]
        private string _cID;
        private string _cName;
        private string _cStatus;
        private string _cpID;
        #endregion
        #region[Public Properties]
        public string cID { get { return _cID; } set { _cID = value; } }
        public string cName { get { return _cName; } set { _cName = value; } }
        public string cStatus { get { return _cStatus; } set { _cStatus = value; } }
        public string cpID { get { return _cpID; } set { _cpID = value; } }
        public string cCode { set; get; }
        #endregion
        #region[Category IDataReader]
        public CategoryInfo CategoryIDataReader(IDataReader dr)
        {
            Data.CategoryInfo obj = new Data.CategoryInfo();
            obj.cID = (dr["cID"] is DBNull) ? string.Empty : dr["cID"].ToString();
            obj.cName = (dr["cName"] is DBNull) ? string.Empty : dr["cName"].ToString();
            obj.cStatus = (dr["cStatus"] is DBNull) ? string.Empty : dr["cStatus"].ToString();
            obj.cpID = (dr["cpID"] is DBNull) ? string.Empty : dr["cpID"].ToString();
            obj.cCode = (dr["cCode"] is DBNull) ? string.Empty : dr["cCode"].ToString();
            return obj;
        }
        #endregion
    }
}